{-# OPTIONS -Wall #-}

-- See RFC 4180

module Demo01 where



import ZCSV.FieldParser
import ZCSV.PrimLexer
import ZCSV.ReadCSV

import Control.Applicative
import qualified Data.Text as T


demo01 = lexer (T.pack "101\n")

demo02 = lexerIO "data/quoted.csv"

demo03 = runCSVParser ((,) <$> field whatever <*> ignore <* endRecord) (T.pack "a,b\na,b\n")
demo03a = runCSVParser ((,) <$> field whatever <*> ignore <* endRecord) (T.pack "a,b\na,b")
 

-- Note - a do-block is an excellent data-structure to avoid 
-- typing issues when trying to build a table of intermediate 
-- parsers that form a larger singular result.
--
-- > useful = do { name <- string
-- >             ; age  <- int
-- >             ; address <- string
-- >             ; return (name, age, address)
-- >             }
--
-- > not_typeable = [string, int, string]
--
